package cn.edu.suda.catalina.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import cn.edu.suda.catalina.service.SampleService;

@Controller
public class SampleController {

	@Autowired
	private SampleService sampleService;

	@RequestMapping("/{index}")
	public String home(@PathVariable String index) {
		return sampleService.name(index);
	}

	@RequestMapping("/selectUserByName")
	@ResponseBody
	public String name() {
		String str = sampleService.selectUserByName("langji");
		return str;
	}

	@RequestMapping("/selectUserListByName")
	@ResponseBody
	public String userList() {
		String str = sampleService.selectUserListByName("langji").toString();
		return str;
	}
}
